#ifndef __BANK_BRANCH_H
#define __BANK_BRANCH_H


#include "Client.h"
#include "Account.h"
#include "Director.h"
#include "SavingsAccount.h"
#include "CurrentAccount.h"

#include <iostream>
#include <vector>

using namespace std;

#define MAX_EMPLOYEES 4
#define MAX_CLIENTS 10

class BankBranch
{
public:
	static BankBranch* Instance();		

			void		addClient(Client& client);
			bool		removeClientById(int id);

			void		addSavingAccountToClientById(int clientId, SavingsAccount& account);
			bool		deleteClientSavingsAccount(int clientId, int savingAccountId);

			void		addEmployee(Employee& emp);
			bool		RemoveEmployee(int id);

			void		updateDirector(Director& director);
			void		updateSalary(int employeeId, int newSalary);

	const	Director&	getBrachDirector()				const;
			int			getNumberOfEmployees()			const;
			int			getNumberOfClients()			const;
			Employee*	getEmployeeByID(int id);
			Employee*	getEmployeeByID(int id, int& index);
			Client*		getClientByID(int id);	
			Client*		getClientByID(int id, int& index);
	const	vector<Employee*>*	getClerks()		const;
	const	vector<Employee*>*	getCashiers()	const;
	const   vector<Client*>		getClients()	const;

	friend	ostream&	operator<<(ostream& os, const BankBranch& b);

	~BankBranch();

private:
			BankBranch(int branchID,const string city);

	static BankBranch* p_Instance;

	int							branchID;
	string						city;
	int							numOfEmployees;
	int							numOfClients;

	vector<Employee*>				employees;
	vector<Client*>				clients;
	Director*					branchDirector;
	
	int			getNextClientIndex();
	int			getNextEmployeeIndex();

	void operator=(const BankBranch& other);
	BankBranch(const BankBranch& bankBranch);
};
#endif